Introduction to R for Researchers

James Bartlett, University of Glasgow

@ York St John

Preparation steps

  • R and RStudio downloaded to your laptop? ✔️
  • Workshop and Quant Fundamentals books open? ✔️
  • Workshop files downloaded? ✔️

Intended learning outcomes

By the end of the workshop, you will be able to:

  1. Write reproducible reports using R Markdown / Quarto.

  2. Clean and wrangle data into appropriate forms for visualisation and analysis.

  3. Use the ggplot2 package for creating a range of plots.

  4. Share/receive code to conduct a brief code review.

Rough schedule

Time Task
11:00 Introduction and introduction to R
12:00 File management and reproducible documents
13:00-13:30 Lunch
13:30-14:30 Data visualisation
14:30-15:30 Data wrangling
15:30-16:30 Code review and wrap up

Why R?

Perfect for researchers

  • Well-integrated tool popular in psychology researchers.

  • Ecosystem of well-maintained packages (e.g., tidyverse).

Perfect for educators

R workflow

Image: Wickham et al. (2023)